Presentation: Tweet"Why Fibers Make Sense For Meteor"
Meteor strives to provide approachable APIs for building high-performing JavaScript apps quickly and with much less code than other frameworks. In service of those lofty goals, one unusual choice we've made is to permit the use of coroutines (also known as Fibers), so that apparently synchronous APIs for things like database access can yield control back to the event loop while in progress. This technique is not without its pitfalls, and JavaScript is gradually developing new features, such as promises, generators, and async functions, that provide some of the power of coroutines. This talk examines the ongoing value of coroutines for Meteor, both today and for the foreseeable future. I'll explain how we keep our sanity in the presence of such a powerful tool, compare code written with Fibers to equivalent code using promises and callbacks, and discuss an ideal synthesis of all these techniques.
Download slides